package edu.uwaterloo.bicyclecomputer.modefunctions;

//import edu.uwaterloo.bicyclecomputer.SystemValues;

public class dts {

	public static double value;
	public static final String name = "dts";
	public static boolean error = false;
	public static boolean overflow = false;
	public static boolean invisible = false;
	
	public static void calculate() {
		if (error) return;
		if (trt.overflow || trt.error)  {
			error = true;
			return;
		}
		try {
			if (true) {
				value = (double) 1.0f * ((trt.value * SystemValues.cir) / (100 * 1000));
				checkValue();
			}
		}
		catch (Exception _e) {
			error = true;
			return;
		}
	}
	
	private static void checkValue() {
		if (value >= 1000) {
			value -=1000;
			overflow = true;
		}

	}
	
	public static String getString() {
		if (error) return "E";
		java.text.DecimalFormat df = new java.text.DecimalFormat("#.##");
		return df.format(value);
		//return String.valueOf(value);
	}
}
